package com.clubmg.controller;

import com.clubmg.service.AdminService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
public class AdminController {

    private AdminService adminService;

    @ResponseBody
    @RequestMapping({"/adman_allow", "/adman_refuse"})
    public int adminAllowOrRefuse(Long uid, Long cid, HttpServletRequest request) {
        int option=-2;
        String servletPath = request.getServletPath();
        if(servletPath.equals("/adman_allow"))option=0;

        adminService.allowOrRefuseSetup(uid,cid,option);


        return 0;
    }

}
